<template>
	<view class="content">
		<view class="gift" style="margin-right: 20rpx;">
			<view class="gift-top">
				<view class="top-left">
					益联券
				</view>
			</view>
			<view class="gift-bottom">
				<text style="font-size: 32rpx;">￥</text>{{info.voucher || 0}}<text style="font-size: 32rpx;">券</text>
			</view>
		</view>
		<view class="small-title">
			使用记录
		</view>
		<view class="gift-item">
			<view class="title">
				我的收益
			</view>
			<view class="bottom">
				<view class="left">
					累计￥{{info.income || 0}}
				</view>
				<view class="right">
					<view class="day">
						<view class="day-top">
							￥{{info.incomeDay || 0}}
						</view>
						<view class="day-bottom">
							今日新增
						</view>
					</view>
					<view class="month">
						<view class="month-top">
							￥{{info.incomeMonth || 0}}
						</view>
						<view class="month-bottom">
							本月新增
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="gift-item">
			<view class="title">
				我的订单
			</view>
			<view class="bottom">
				<view class="left">
					累计{{info.order || 0 }}<text style="font-size: 24rpx;font-weight: 400;">笔</text>
				</view>
				<view class="right">
					<view class="day">
						<view class="day-top">
							{{info.orderDay || 0}}个
						</view>
						<view class="day-bottom">
							今日新增
						</view>
					</view>
					<view class="month">
						<view class="month-top">
							{{info.orderMonth || 0}}个
						</view>
						<view class="month-bottom">
							本月新增
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="gift-item" @click="navigate('/page_other/bus_data/promotion')">
			<view class="title">
				我的推广
			</view>
			<view class="bottom">
				<view class="left">
					累计{{info.promotion || 0}} <text style="font-size: 24rpx;font-weight: 400;">人</text>
				</view>
				<view class="right">
					<view class="day">
						<view class="day-top">
							{{info.promotionDay || 0}}次
						</view>
						<view class="day-bottom">
							今日新增
						</view>
					</view>
					<view class="month">
						<view class="month-top">
							{{info.promotionMonth || 0}}次
						</view>
						<view class="month-bottom">
							本月新增
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getBusinessData
	} from '@/api/mine.js'
	export default {
		data() {
			return {
				info: {
					voucher: '',
					income: '',
					incomeDay: '',
					incomeMonth: '',
					order: '',
					orderDay: '',
					orderMonth: '',
					promotion: '',
					promotionDay: '',
					promotionMonth: ''
				},
			}
		},
		methods: {
			//商家经营数据
			getBusiness() {
				uni.showLoading({
					title: '加载中',
					mask: true
				})
				getBusinessData().then((res) => {
					this.info = res
				})
			},
		},
		onLoad() {
			//商家经营数据
			this.getBusiness()
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		padding: 20rpx 30rpx 0;

		.info-block {
			background: #ffffff;
			padding: 30rpx;
			margin-bottom: 20rpx;


		}

		.gift {
			width: 100%;
			height: 300rpx;
			background-image: url('https://job-1306862033.cos.ap-chengdu.myqcloud.com/miniprogram-static/alliance/mine.png');
			background-size: 100%;
			padding: 40rpx 40rpx;
			border-radius: 20rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;

			.gift-top {
				display: flex;
				justify-content: space-between;

				.top-left {
					color: #FFFFFF;
					font-size: 32rpx;
				}

				.top-right {
					width: 30rpx;
					height: 30rpx;
				}

			}

			.gift-bottom {
				margin-top: 20rpx;
				font-size: 64rpx;
				color: #FFFFFF;
			}
		}

		.small-title {
			font-family: FZHanZhenGuangBiaoS-GB;
			font-size: 18px;
			font-weight: normal;
			line-height: normal;
			letter-spacing: 0em;
			color: #FF2F34;
			margin: 30rpx 0 20rpx 0;
		}

		.gift-item {
			background: #FFFFFF;
			padding: 30rpx;
			margin-bottom: 20rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;

			.title {
				font-size: 32rpx;
				font-weight: bold;
				line-height: 22px;
				letter-spacing: 0px;
				color: #1A1A1A;
				margin-bottom: 20rpx;
			}

			.bottom {
				display: flex;
				justify-content: space-between;
				align-items: center;

				.left {
					font-size: 32rpx;
					font-weight: bold;
					line-height: 22px;
					letter-spacing: 0px;
					color: #1A1A1A;
				}

				.right {
					display: flex;
					width: 50%;
					justify-content: space-between;

					.day {

						.day-top {
							margin-bottom: 10rpx;
						}
					}

					.month {

						.month-top {
							margin-bottom: 10rpx;
						}
					}
				}
			}
		}
	}
</style>